#ifndef WS2812_H
#define WS2812_H

#include "main.h"
/*WS2812--0码*/
#define WS2812_0_CODE   3
/*WS2812--1码*/
#define WS2812_1_CODE   7
/*WS2812--灯数量*/
#define WS2812_LED_Number   8
/*WS2812--RGB基址*/
#define WS2812_LED_R_BASE   8
#define WS2812_LED_G_BASE   0
#define WS2812_LED_B_BASE   16
/*跑马灯开启标志*/
#define LED_Left            1
#define LED_Right			2
/*跑马灯模式*/
#define Circulation			1
#define Single				2

extern uint16_t WS2812_LED_Out_Buffer[24 * WS2812_LED_Number];
extern uint8_t WS2812_LED_marquee_Flag;

/*基础结构体*/
typedef struct
{
	uint8_t Color_R;
	uint8_t Color_G;
	uint8_t Color_B;

}WS2812_LED_RGB_TypeInit;

/*灯效结构体*/
typedef struct
{
	uint8_t Color_R[WS2812_LED_Number];
	uint8_t Color_G[WS2812_LED_Number];
	uint8_t Color_B[WS2812_LED_Number];

}WS2812_LED_RGB_Lighting_Effects_Init;

extern WS2812_LED_RGB_TypeInit WS2812_LED_RGB_homochromy_Value;
extern WS2812_LED_RGB_Lighting_Effects_Init WS2812_LED_RGB_heterochrome_Value;

void WS2812_PWM_Out_Compar_Buffer_Config(WS2812_LED_RGB_TypeInit * WS2812_LED_RGB_Value);
void WS2812_PWM_Out_Compar_Buffer_Config_Reset(WS2812_LED_RGB_TypeInit * WS2812_LED_RGB_Value);
void WS2812_Lighting_Effects_Config(WS2812_LED_RGB_Lighting_Effects_Init * WS2812_LED_RGB_Value);
void WS2812_Lighting_Effects_Config_Reset(WS2812_LED_RGB_Lighting_Effects_Init * WS2812_LED_RGB_Value);

void Left_Run_Led(WS2812_LED_RGB_TypeInit * RGB_Color,uint8_t Mode);
void Right_Run_Led(WS2812_LED_RGB_TypeInit * RGB_Color,uint8_t Mode);;
void Location_LED(uint8_t * RX_Buf);


#endif
